<?php
// +----------------------------------------------------------------------
// | najing [ 通用后台管理系统 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020 http://www.najingquan.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: lin
// +----------------------------------------------------------------------

namespace  app\admin\controller;

use app\common\controller\AdminController;
use app\common\model\Operation;
use http\Exception;
use think\Console;
use think\facade\Cache;
use think\facade\View;

/**
 * 首页管理
 * Class Index
 * @package app\admin\controller
 */
class Index extends  AdminController {

    /**
     * 首页
     * @author lin
     */
    public function  index() {
        View::layout(false);
        $operationModel = new Operation();
        View::assign('menu', $operationModel->manageMenu(session('manage')['id']));
        return View::fetch();

    }

    /**
     * 欢迎页
     * @author lin
     */
    public function  welcome() {
        View::assign('unpaid_count', 0);
        View::assign('unship_count', 0);
        View::assign('after_sales_count', 0);
        View::assign('goods_statics', 0);
        return View::fetch();
    }

    /**
     * 清除整站全部缓存
     * @author lin
     */
    public function clearCache()
    {
        Cache::clear();
        return redirect(url('index/welcome'));
    }

}
